﻿/// <summary>
/// https://leetcode-cn.com/problems/rotate-image/
/// </summary>
public class Solution
{
    public void Rotate(int[][] matrix)
    {
        var n = matrix.Length;
        for (int i = 0; i < n / 2; i++)
        {
            var t = matrix[i];
            matrix[i] = matrix[n - i - 1];
            matrix[n - i - 1] = t;
        }
        for (int i = 0; i < n; i++)
        {
            for (int j = i; j < n; j++)
            {
                var t = matrix[i][j];
                matrix[i][j] = matrix[j][i];
                matrix[j][i] = t;
            }
        }
    }
}